package com.isoft.dailymanprovidor.controller;

import com.isoft.dailymanprovidor.bean.ResponseData;
import com.isoft.dailymanprovidor.entity.MeetingMinutes;
import com.isoft.dailymanprovidor.service.MeetingMinutesService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@Slf4j
@RequestMapping("/systemdailyman/meetingminutes")
public class MeetingMinutesController extends BaseController{
    @Autowired
    MeetingMinutesService meetingMinutesService;
    //分页获取全部会议室信息
    @GetMapping("/getall")
    public ResponseData getall(Integer currentPage, Integer size){
        return meetingMinutesService.getall(currentPage, size);
    }
    //分页查询会议室信息
    @GetMapping("/getallmeetingmintues")
    public ResponseData getallmeetingmintues(Integer currentPage, Integer size,String meetingtitle,String meetingtime,String status){
        return meetingMinutesService.getallmeetingmintues(currentPage, size, meetingtitle, meetingtime, status);
    }
    //查询会议纪要是否记录过
    @GetMapping("/existmeetingtitle")
    public ResponseData<Boolean> meetingtitleexist(MeetingMinutes meetingMinutes){
        return returnBoolean(meetingMinutesService.existmeetingtitle(meetingMinutes));
    }
    //新增会议纪要
    @PutMapping("/addmeetingmintues")
    public ResponseData<Boolean> addmeetingmintues(@RequestBody MeetingMinutes meetingMinutes){
        return returnBoolean(meetingMinutesService.addmeetingmintues(meetingMinutes));
    }
    //修改会议纪要
    @PutMapping("/updatemeetingmintues")
    public ResponseData<Boolean> update(@RequestBody MeetingMinutes meetingMinutes){
        return returnBoolean(meetingMinutesService.updatemeeting(meetingMinutes));
    }
    //状态改为归档（1）
    @PutMapping("/updatestatus")
    public ResponseData<Boolean> updatestatue(@RequestBody MeetingMinutes meetingMinutes){
        return returnBoolean(meetingMinutesService.updatestatus(meetingMinutes));
    }
}
